home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / super_ka.swf / scripts / frame_115 / DoAction.as
Encoding:
Text File  |  2011-06-09  |  35.9 KB  |  1,339 lines

  1. function AddLifeFunc()
  2. {
  3.    var _loc1_ = Math.floor(game.totalScores / lifeUpNum);
  4.    if(_loc1_ != addLife)
  5.    {
  6.       addLife++;
  7.       game.totalLives = game.totalLives + 1;
  8.       _root.heroLife = _root.heroLife + 1;
  9.       below_mask.lifeShow = game.totalLives;
  10.    }
  11. }
  12. function buildMap(map)
  13. {
  14.    below_mask.gateShow = game.currentGate;
  15.    _root.attachMovie("empty","tiles",1);
  16.    game.clip = _root.tiles;
  17.    var bgName = "gate" + game.currentGate + "_" + "bg" + game.currentMap;
  18.    game.clip.attachMovie(bgName,bgName,4000);
  19.    game.clip[bgName]._x = 40;
  20.    var bgMaskName = "gate" + game.currentGate + "_" + "bg" + game.currentMap + "_mask";
  21.    game.clip.attachMovie(bgMaskName,bgMaskName,19000);
  22.    game.clip[bgMaskName]._x = 40;
  23.    game.clip._x = -40;
  24.    if(game.currentMap != game.totalMap)
  25.    {
  26.       game.clip._y = -80;
  27.       game.clip[bgName]._y = 80;
  28.       game.clip[bgMaskName]._y = 80;
  29.    }
  30.    else
  31.    {
  32.       game.clip._y = -40;
  33.       game.clip[bgName]._y = 40;
  34.       game.clip[bgMaskName]._y = 40;
  35.    }
  36.    var mapWidth = map[0].length;
  37.    var mapHeight = map.length;
  38.    var k = 5000;
  39.    var _loc3_ = 0;
  40.    while(_loc3_ < mapHeight)
  41.    {
  42.       var _loc2_ = 0;
  43.       while(_loc2_ < mapWidth)
  44.       {
  45.          var _loc1_ = "t_" + _loc3_ + "_" + _loc2_;
  46.          game[_loc1_] = new game["Tile" + map[_loc3_][_loc2_]]();
  47.          game.clip.attachMovie("tile",_loc1_,k);
  48.          game.clip[_loc1_]._x = _loc2_ * game.tileW;
  49.          game.clip[_loc1_]._y = _loc3_ * game.tileH;
  50.          game.clip[_loc1_].gotoAndStop(game[_loc1_].frame);
  51.          if(game[_loc1_].item != "")
  52.          {
  53.             game.clip[_loc1_].attachMovie(game[_loc1_].item,"item",k);
  54.          }
  55.          k++;
  56.          _loc2_ = _loc2_ + 1;
  57.       }
  58.       _loc3_ = _loc3_ + 1;
  59.    }
  60.    game.items = myItems[game.currentMap];
  61.    _loc3_ = 0;
  62.    while(_loc3_ < game.items.length)
  63.    {
  64.       _loc1_ = "item" + game.items[_loc3_][2] + "_" + game.items[_loc3_][1];
  65.       game[_loc1_] = new game["Item" + game.items[_loc3_][0]]();
  66.       game[_loc1_].position = _loc3_;
  67.       game.clip.attachMovie("items",_loc1_,10001 + _loc3_);
  68.       game[_loc1_].clip = game.clip[_loc1_];
  69.       game[_loc1_].clip._x = game.items[_loc3_][1] * game.tileW + game.tileW / 2;
  70.       game[_loc1_].clip._y = game.items[_loc3_][2] * game.tileH + game.tileH / 2;
  71.       game[_loc1_].clip.gotoAndStop(game.items[_loc3_][0]);
  72.       _loc3_ = _loc3_ + 1;
  73.    }
  74.    var enemies = myEnemies[game.currentMap];
  75.    game.currentEnemies = [];
  76.    _loc3_ = 0;
  77.    while(_loc3_ < enemies.length)
  78.    {
  79.       _loc1_ = "enemy" + _loc3_;
  80.       game[_loc1_] = new game["Enemyp" + enemies[_loc3_][0]]();
  81.       game[_loc1_].type = enemies[_loc3_][0];
  82.       game[_loc1_].id = _loc3_;
  83.       game.currentEnemies.push(game[_loc1_]);
  84.       game.clip.attachMovie("enemy" + enemies[_loc3_][0],_loc1_,11001 + _loc3_);
  85.       game[_loc1_].clip = game.clip[_loc1_];
  86.       game[_loc1_].xtile = enemies[_loc3_][1];
  87.       game[_loc1_].ytile = enemies[_loc3_][2];
  88.       game[_loc1_].width = game.clip[_loc1_]._width / 2;
  89.       game[_loc1_].height = game.clip[_loc1_]._height / 2;
  90.       game[_loc1_].x = game[_loc1_].xtile * game.tileW + game.tileW / 2;
  91.       game[_loc1_].y = (game[_loc1_].ytile + 1) * game.tileH - game[_loc1_].height;
  92.       game[_loc1_].clip._x = game[_loc1_].x;
  93.       game[_loc1_].clip._y = game[_loc1_].y;
  94.       _loc3_ = _loc3_ + 1;
  95.    }
  96.    game.movingtiles = myMovingTiles[game.currentMap];
  97.    _loc3_ = 0;
  98.    while(_loc3_ < game.movingtiles.length)
  99.    {
  100.       _loc1_ = "movingtile" + _loc3_;
  101.       game[_loc1_] = new game["MovingTilep" + game.movingtiles[_loc3_][0]]();
  102.       game.clip.attachMovie("movingtiles",_loc1_,13001 + _loc3_);
  103.       game[_loc1_].clip = game.clip[_loc1_];
  104.       game[_loc1_].clip.gotoAndStop(game.movingtiles[_loc3_][0]);
  105.       game[_loc1_].xtile = game.movingtiles[_loc3_][1];
  106.       game[_loc1_].ytile = game.movingtiles[_loc3_][2];
  107.       game[_loc1_].x = game[_loc1_].xtile * game.tileW + game.tileW / 2;
  108.       game[_loc1_].y = game[_loc1_].ytile * game.tileH + game.tileH / 2;
  109.       game[_loc1_].clip._x = game[_loc1_].x;
  110.       game[_loc1_].clip._y = game[_loc1_].y;
  111.       game[_loc1_].minx += game[_loc1_].xtile;
  112.       game[_loc1_].maxx += game[_loc1_].xtile;
  113.       game[_loc1_].miny += game[_loc1_].ytile;
  114.       game[_loc1_].maxy += game[_loc1_].ytile;
  115.       _loc3_ = _loc3_ + 1;
  116.    }
  117.    game.clip.attachMovie("char","char",10000);
  118.    char.clip = game.clip.char;
  119.    if(char.undead == true)
  120.    {
  121.       char.clip._alpha = 0;
  122.    }
  123.    char.width = char.clip._width / 2;
  124.    char.height = char.clip._height / 2;
  125.    char.x = char.xtile * game.tileW + game.tileW / 2;
  126.    char.y = (char.ytile + 1) * game.tileH - char.height;
  127.    char.clip._x = char.x;
  128.    char.clip._y = char.y;
  129.    char.clip.gotoAndStop(char.frame);
  130.    if(game.currentMap == game.totalMap)
  131.    {
  132.       game.clip.attachMovie("gateDoor","gateDoor",9999);
  133.       game.clip.gateDoor._x = game.tileW * game.gateDoorX;
  134.       game.clip.gateDoor._y = game.tileH * game.gateDoorY;
  135.    }
  136. }
  137. function addChar()
  138. {
  139.    game.clip.attachMovie("char","char",10000);
  140.    char.clip = game.clip.char;
  141.    char.clip._alpha = 0;
  142.    char.undead = true;
  143.    char.width = char.clip._width / 2;
  144.    char.height = char.clip._height / 2;
  145.    char.x = char.xtile * game.tileW + game.tileW / 2;
  146.    char.y = (char.ytile + 1) * game.tileH - char.height;
  147.    char.clip._x = char.x;
  148.    char.clip._y = char.y;
  149.    char.clip.gotoAndStop(char.frame);
  150. }
  151. function changeMap(ob)
  152. {
  153.    var _loc2_ = ob;
  154.    var _loc3_ = [];
  155.    var _loc1_ = 0;
  156.    while(_loc1_ < game.items.length)
  157.    {
  158.       if(game.items[_loc1_])
  159.       {
  160.          var name = "item" + game.items[_loc1_][2] + "_" + game.items[_loc1_][1];
  161.          delete game[name];
  162.          _loc3_.push(game.items[_loc1_]);
  163.       }
  164.       _loc1_ = _loc1_ + 1;
  165.    }
  166.    myItems[game.currentMap] = _loc3_;
  167.    var name = "t_" + _loc2_.ytile + "_" + _loc2_.xtile;
  168.    game.currentMap = game[name].newmap;
  169.    _loc2_.xtile = _loc2_.xtile;
  170.    game.oldMap = game[name].oldmap;
  171.    if(game.currentMap < game.oldMap)
  172.    {
  173.       _loc2_.ytile = 1;
  174.    }
  175.    else
  176.    {
  177.       _loc2_.ytile = 9;
  178.    }
  179.    _loc2_.frame = _loc2_.clip._currentframe;
  180.    var charAlpha = char.clip._alpha;
  181.    buildMap(_root["myMap" + game.currentMap]);
  182.    char.clip._alpha = charAlpha;
  183. }
  184. function getMyCorners(x, y, ob)
  185. {
  186.    var _loc1_ = ob;
  187.    _loc1_.downY = Math.floor((y + _loc1_.height - 1) / game.tileH);
  188.    _loc1_.upY = Math.floor((y - _loc1_.height) / game.tileH);
  189.    _loc1_.leftX = Math.floor((x - _loc1_.width) / game.tileW);
  190.    _loc1_.rightX = Math.floor((x + _loc1_.width - 1) / game.tileW);
  191.    _loc1_.upleft = game["t_" + _loc1_.upY + "_" + _loc1_.leftX].walkable;
  192.    _loc1_.downleft = game["t_" + _loc1_.downY + "_" + _loc1_.leftX].walkable;
  193.    _loc1_.upright = game["t_" + _loc1_.upY + "_" + _loc1_.rightX].walkable;
  194.    _loc1_.downright = game["t_" + _loc1_.downY + "_" + _loc1_.rightX].walkable;
  195. }
  196. function moveChar(ob, dirx, diry, fly)
  197. {
  198.    var _loc1_ = ob;
  199.    var _loc2_ = diry;
  200.    var _loc3_ = dirx;
  201.    if(_loc3_ != 0)
  202.    {
  203.       _loc1_.dirx = _loc3_;
  204.    }
  205.    if(Math.abs(fly) == 1)
  206.    {
  207.       speed = _loc1_.flyspeed * fly;
  208.    }
  209.    else
  210.    {
  211.       speed = _loc1_.speed;
  212.    }
  213.    _loc1_.lasty = _loc1_.y;
  214.    getMyCorners(_loc1_.x,_loc1_.y + speed * _loc2_,_loc1_);
  215.    if(_loc2_ == -1)
  216.    {
  217.       if(_loc1_.upleft && _loc1_.upright)
  218.       {
  219.          _loc1_.y += speed * _loc2_;
  220.       }
  221.       else
  222.       {
  223.          _loc1_.y = _loc1_.ytile * game.tileH + _loc1_.height;
  224.          _loc1_.flyspeed = 0;
  225.       }
  226.    }
  227.    if(_loc2_ == 1)
  228.    {
  229.       if(_loc1_.downleft && _loc1_.downright && !checkMovingTiles(speed * _loc2_))
  230.       {
  231.          _loc1_.y += speed * _loc2_;
  232.       }
  233.       else if(_loc1_.downleft == undefined && _loc1_.downright == undefined && !checkMovingTiles(speed * _loc2_))
  234.       {
  235.          _loc1_.y += speed * _loc2_;
  236.       }
  237.       else
  238.       {
  239.          if(_loc1_.onMovingTile)
  240.          {
  241.             _loc1_.y = _loc1_.onMovingTile.y - _loc1_.onMovingTile.height - _loc1_.height;
  242.          }
  243.          else if(_loc1_.ytile + 2 == _loc1_.downY)
  244.          {
  245.             _loc1_.y = (_loc1_.ytile + 2) * game.tileH - _loc1_.height;
  246.          }
  247.          else
  248.          {
  249.             _loc1_.y = (_loc1_.ytile + 1) * game.tileH - _loc1_.height;
  250.          }
  251.          _loc1_.fly = false;
  252.       }
  253.    }
  254.    getMyCorners(_loc1_.x + speed * _loc3_,_loc1_.y,_loc1_);
  255.    if(_loc3_ == -1)
  256.    {
  257.       if(_loc1_.downleft && _loc1_.upleft)
  258.       {
  259.          _loc1_.x += speed * _loc3_;
  260.          fall(_loc1_);
  261.       }
  262.       else
  263.       {
  264.          _loc1_.x = _loc1_.xtile * game.tileW + _loc1_.width;
  265.       }
  266.    }
  267.    if(_loc3_ == 1)
  268.    {
  269.       if(_loc1_.upright && _loc1_.downright)
  270.       {
  271.          _loc1_.x += speed * _loc3_;
  272.          fall(_loc1_);
  273.       }
  274.       else
  275.       {
  276.          _loc1_.x = (_loc1_.xtile + 1) * game.tileW - _loc1_.width;
  277.       }
  278.    }
  279.    updateChar(_loc1_,_loc3_,_loc2_);
  280.    return true;
  281. }
  282. function moveChar2(ob, dirx, diry, jump)
  283. {
  284.    var _loc1_ = ob;
  285.    var _loc2_ = dirx;
  286.    var _loc3_ = diry;
  287.    if(_loc2_ != 0)
  288.    {
  289.       _loc1_.dirx = _loc2_;
  290.    }
  291.    if(Math.abs(jump) == 1)
  292.    {
  293.       speed = _loc1_.jumpspeed * jump;
  294.    }
  295.    else
  296.    {
  297.       speed = _loc1_.speed;
  298.    }
  299.    getMyCorners(_loc1_.x,_loc1_.y + speed * _loc3_,_loc1_);
  300.    if(_loc3_ == -1)
  301.    {
  302.       if(_loc1_.upleft && _loc1_.upright)
  303.       {
  304.          _loc1_.y += speed * _loc3_;
  305.       }
  306.       else
  307.       {
  308.          _loc1_.y = _loc1_.ytile * game.tileH + _loc1_.height;
  309.          _loc1_.jumpspeed = 0;
  310.       }
  311.    }
  312.    if(_loc3_ == 1)
  313.    {
  314.       if(_loc1_.downleft && _loc1_.downright && !checkMovingTiles(speed * _loc3_))
  315.       {
  316.          _loc1_.y += speed * _loc3_;
  317.       }
  318.       else
  319.       {
  320.          _loc1_.y = (_loc1_.ytile + 1) * game.tileH - _loc1_.height;
  321.          _loc1_.jump = false;
  322.       }
  323.    }
  324.    getMyCorners(_loc1_.x + speed * _loc2_,_loc1_.y,_loc1_);
  325.    if(_loc2_ == -1)
  326.    {
  327.       if(_loc1_.downleft && _loc1_.upleft)
  328.       {
  329.          _loc1_.x += speed * _loc2_;
  330.          fall2(_loc1_);
  331.       }
  332.       else
  333.       {
  334.          _loc1_.x = _loc1_.xtile * game.tileW + _loc1_.width;
  335.       }
  336.    }
  337.    if(_loc2_ == 1)
  338.    {
  339.       if(_loc1_.upright && _loc1_.downright)
  340.       {
  341.          _loc1_.x += speed * _loc2_;
  342.          fall2(_loc1_);
  343.       }
  344.       else
  345.       {
  346.          _loc1_.x = (_loc1_.xtile + 1) * game.tileW - _loc1_.width;
  347.       }
  348.    }
  349.    updateChar(_loc1_,_loc2_,_loc3_);
  350.    return true;
  351. }
  352. function moveChar3(ob, dirx, diry, fly)
  353. {
  354.    var _loc1_ = ob;
  355.    var _loc2_ = dirx;
  356.    if(_loc2_ != 0)
  357.    {
  358.       _loc1_.dirx = _loc2_;
  359.    }
  360.    speed = _loc1_.speed;
  361.    getMyCorners(_loc1_.x + speed * _loc2_,_loc1_.y,_loc1_);
  362.    if(_loc1_.speed > 0)
  363.    {
  364.       if(_loc2_ == -1)
  365.       {
  366.          if(_loc1_.downleft && _loc1_.upleft)
  367.          {
  368.             _loc1_.x += speed * _loc2_;
  369.          }
  370.          else
  371.          {
  372.             _loc1_.clip._xscale = - _loc1_.clip._xscale;
  373.             _loc1_.xMove = - _loc1_.xMove;
  374.             _loc1_.yMove = - _loc1_.yMove;
  375.          }
  376.       }
  377.       if(_loc2_ == 1)
  378.       {
  379.          if(_loc1_.upright && _loc1_.downright)
  380.          {
  381.             _loc1_.x += speed * _loc2_;
  382.          }
  383.          else
  384.          {
  385.             _loc1_.clip._xscale = - _loc1_.clip._xscale;
  386.             _loc1_.xMove = - _loc1_.xMove;
  387.             _loc1_.yMove = - _loc1_.yMove;
  388.          }
  389.       }
  390.    }
  391.    if(_loc1_.speed < 0)
  392.    {
  393.       if(_loc2_ == 1)
  394.       {
  395.          if(_loc1_.downleft && _loc1_.upleft)
  396.          {
  397.             _loc1_.x += speed * _loc2_;
  398.          }
  399.          else
  400.          {
  401.             _loc1_.clip._xscale = - _loc1_.clip._xscale;
  402.             _loc1_.xMove = - _loc1_.xMove;
  403.             _loc1_.yMove = - _loc1_.yMove;
  404.          }
  405.       }
  406.       if(_loc2_ == -1)
  407.       {
  408.          if(_loc1_.upright && _loc1_.downright)
  409.          {
  410.             _loc1_.x += speed * _loc2_;
  411.          }
  412.          else
  413.          {
  414.             _loc1_.clip._xscale = - _loc1_.clip._xscale;
  415.             _loc1_.xMove = - _loc1_.xMove;
  416.             _loc1_.yMove = - _loc1_.yMove;
  417.          }
  418.       }
  419.    }
  420.    updateChar(_loc1_,_loc2_,diry);
  421.    return true;
  422. }
  423. function moveChar4(ob, dirx, diry)
  424. {
  425.    var _loc1_ = ob;
  426.    var _loc2_ = dirx;
  427.    speed = _loc1_.speed;
  428.    getMyCorners(_loc1_.x + speed * _loc2_,_loc1_.y,_loc1_);
  429.    if(_loc1_.speed > 0)
  430.    {
  431.       if(_loc2_ == -1)
  432.       {
  433.          if(_loc1_.upleft)
  434.          {
  435.             _loc1_.x += speed * _loc2_;
  436.          }
  437.          else
  438.          {
  439.             _loc1_.xMove = - _loc1_.xMove;
  440.             _loc1_.yMove = - _loc1_.yMove;
  441.          }
  442.       }
  443.       if(_loc2_ == 1)
  444.       {
  445.          if(_loc1_.upright)
  446.          {
  447.             _loc1_.x += speed * _loc2_;
  448.          }
  449.          else
  450.          {
  451.             _loc1_.xMove = - _loc1_.xMove;
  452.             _loc1_.yMove = - _loc1_.yMove;
  453.          }
  454.       }
  455.    }
  456.    if(_loc1_.speed < 0)
  457.    {
  458.       if(_loc2_ == 1)
  459.       {
  460.          if(_loc1_.upleft)
  461.          {
  462.             _loc1_.x += speed * _loc2_;
  463.          }
  464.          else
  465.          {
  466.             _loc1_.xMove = - _loc1_.xMove;
  467.             _loc1_.yMove = - _loc1_.yMove;
  468.          }
  469.       }
  470.       if(_loc2_ == -1)
  471.       {
  472.          if(_loc1_.upright)
  473.          {
  474.             _loc1_.x += speed * _loc2_;
  475.          }
  476.          else
  477.          {
  478.             _loc1_.xMove = - _loc1_.xMove;
  479.             _loc1_.yMove = - _loc1_.yMove;
  480.          }
  481.       }
  482.    }
  483.    updateChar(_loc1_,_loc2_,diry);
  484.    return true;
  485. }
  486. function checkMovingTiles(y)
  487. {
  488.    var heroymax = char.y + char.height + y;
  489.    var heroxmax = char.x + char.width;
  490.    var heroxmin = char.x - char.width;
  491.    foundit = false;
  492.    var _loc2_ = 0;
  493.    while(_loc2_ < game.movingtiles.length)
  494.    {
  495.       var _loc1_ = game["movingtile" + _loc2_];
  496.       var tileymax = _loc1_.y + _loc1_.height;
  497.       var _loc3_ = _loc1_.y - _loc1_.height;
  498.       var tilexmax = _loc1_.x + _loc1_.width;
  499.       var _loc3 = _loc1_.x - _loc1_.width;
  500.       if(char.lasty + char.height <= _loc3_)
  501.       {
  502.          if(heroymax <= tileymax && heroymax >= _loc3_)
  503.          {
  504.             if(heroxmax > _loc3 && heroxmax < tilexmax)
  505.             {
  506.                char.onMovingTile = _loc1_;
  507.                foundit = true;
  508.                break;
  509.             }
  510.             if(heroxmin > _loc3 && heroxmin < tilexmax)
  511.             {
  512.                char.onMovingTile = _loc1_;
  513.                foundit = true;
  514.                break;
  515.             }
  516.          }
  517.       }
  518.       _loc2_ = _loc2_ + 1;
  519.    }
  520.    return foundit;
  521. }
  522. function moveTiles()
  523. {
  524.    var _loc2_ = 0;
  525.    while(_loc2_ < game.movingtiles.length)
  526.    {
  527.       var _loc1_ = game["movingtile" + _loc2_];
  528.       getMyCorners(_loc1_.x + _loc1_.speed * _loc1_.dirx,_loc1_.y + _loc1_.speed * _loc1_.diry,_loc1_);
  529.       if(_loc1_.miny > _loc1_.upY || _loc1_.maxy < _loc1_.downY)
  530.       {
  531.          _loc1_.diry = - _loc1_.diry;
  532.       }
  533.       if(_loc1_.minx > _loc1_.leftX || _loc1_.maxx < _loc1_.rightX)
  534.       {
  535.          _loc1_.dirx = - _loc1_.dirx;
  536.       }
  537.       _loc1_.x += _loc1_.speed * _loc1_.dirx;
  538.       _loc1_.y += _loc1_.speed * _loc1_.diry;
  539.       _loc1_.xtile = Math.floor(_loc1_.x / game.tileW);
  540.       _loc1_.ytile = Math.floor(_loc1_.y / game.tileH);
  541.       _loc1_.clip._x = _loc1_.x;
  542.       _loc1_.clip._y = _loc1_.y;
  543.       if(_loc1_.diry == -1)
  544.       {
  545.          checkMovingTiles(0);
  546.       }
  547.       _loc2_ = _loc2_ + 1;
  548.    }
  549.    if(char.onMovingTile)
  550.    {
  551.       getMyCorners(char.x,char.y + char.onMovingTile.speed * char.onMovingTile.diry,char);
  552.       if(char.onMovingTile.diry == -1)
  553.       {
  554.          if(char.upleft && char.upright)
  555.          {
  556.             char.y = char.onMovingTile.y - char.onMovingTile.height - char.height;
  557.          }
  558.          else
  559.          {
  560.             char.y = char.ytile * game.tileH + char.height;
  561.             char.jumpspeed = 0;
  562.             char.jump = true;
  563.             char.onMovingTile = false;
  564.          }
  565.       }
  566.       if(char.onMovingTile.diry == 1)
  567.       {
  568.          if(char.downleft && char.downright)
  569.          {
  570.             char.y = char.onMovingTile.y - char.onMovingTile.height - char.height;
  571.          }
  572.          else
  573.          {
  574.             char.onMovingTile = false;
  575.             char.y = (char.ytile + 1) * game.tileH - char.height;
  576.          }
  577.       }
  578.       getMyCorners(char.x + char.onMovingTile.speed * char.onMovingTile.dirx,char.y,char);
  579.       if(char.onMovingTile.dirx == -1)
  580.       {
  581.          if(char.downleft && char.upleft)
  582.          {
  583.             char.x += char.onMovingTile.speed * char.onMovingTile.dirx;
  584.          }
  585.          else
  586.          {
  587.             char.x = char.xtile * game.tileW + char.width;
  588.             fall(char);
  589.          }
  590.       }
  591.       if(char.onMovingTile.dirx == 1)
  592.       {
  593.          if(char.upright && char.downright)
  594.          {
  595.             char.x += char.onMovingTile.speed * char.onMovingTile.dirx;
  596.          }
  597.          else
  598.          {
  599.             fall(char);
  600.             char.x = (char.xtile + 1) * game.tileW - char.width;
  601.          }
  602.       }
  603.       updateChar(char);
  604.    }
  605. }
  606. function updateChar(ob, dirx, diry)
  607. {
  608.    var _loc1_ = ob;
  609.    var _loc3_ = _root;
  610.    _loc1_.clip._x = _loc1_.x;
  611.    _loc1_.clip._y = _loc1_.y;
  612.    _loc1_.xtile = Math.floor(_loc1_.clip._x / game.tileW);
  613.    _loc1_.ytile = Math.floor(_loc1_.clip._y / game.tileH);
  614.    if(game["t_" + _loc1_.ytile + "_" + _loc1_.xtile].door && _loc1_ == _loc3_.char)
  615.    {
  616.       changeMap(_loc1_);
  617.    }
  618.    var _loc2_ = game["item" + _loc1_.ytile + "_" + _loc1_.xtile];
  619.    if(_loc2_ && _loc1_ == _loc3_.char)
  620.    {
  621.       if(_loc2_.typeNum == 1)
  622.       {
  623.          below_mask.bottleShow = below_mask.bottleShow + 1;
  624.          game.havingBottle += 1;
  625.          effectSoundFunc("bottle");
  626.       }
  627.       else if(_loc2_.typeNum == 2)
  628.       {
  629.          game.totalScores += 200;
  630.          AddLifeFunc();
  631.          _loc3_.below_mask.scoreShow = game.totalScores;
  632.          effectSoundFunc("coin2");
  633.       }
  634.       else if(_loc2_.typeNum == 3)
  635.       {
  636.          game.totalScores += 100;
  637.          AddLifeFunc();
  638.          _loc3_.below_mask.scoreShow = game.totalScores;
  639.          effectSoundFunc("coin1");
  640.       }
  641.       else if(_loc2_.typeNum == 4)
  642.       {
  643.          game.totalScores += 300;
  644.          AddLifeFunc();
  645.          _loc3_.below_mask.scoreShow = game.totalScores;
  646.          effectSoundFunc("coin3");
  647.       }
  648.       else if(_loc2_.typeNum == 5)
  649.       {
  650.          game.totalScores += 400;
  651.          AddLifeFunc();
  652.          _loc3_.below_mask.scoreShow = game.totalScores;
  653.          effectSoundFunc("coin4");
  654.       }
  655.       else if(_loc2_.typeNum == 6)
  656.       {
  657.          game.totalScores += 500;
  658.          AddLifeFunc();
  659.          _loc3_.below_mask.scoreShow = game.totalScores;
  660.          effectSoundFunc("coin5");
  661.       }
  662.       else if(_loc2_.typeNum == 7)
  663.       {
  664.          game.totalScores += 1000;
  665.          AddLifeFunc();
  666.          _loc3_.below_mask.scoreShow = game.totalScores;
  667.          effectSoundFunc("coin6");
  668.       }
  669.       else if(_loc2_.typeNum == 8)
  670.       {
  671.          below_mask.btn1._visible = true;
  672.          effectSoundFunc("other1");
  673.       }
  674.       else if(_loc2_.typeNum == 9)
  675.       {
  676.          below_mask.btn2._visible = true;
  677.          effectSoundFunc("other2");
  678.       }
  679.       else if(_loc2_.typeNum == 10)
  680.       {
  681.          below_mask.btn3._visible = true;
  682.          effectSoundFunc("other3");
  683.       }
  684.       else if(_loc2_.typeNum == 11)
  685.       {
  686.          below_mask.btn4._visible = true;
  687.          effectSoundFunc("other4");
  688.       }
  689.       removeMovieClip(_loc2_.clip);
  690.       game.items[_loc2_.position] = 0;
  691.       delete game["item" + _loc1_.ytile + "_" + _loc1_.xtile];
  692.    }
  693. }
  694. function jump(ob)
  695. {
  696.    var _loc1_ = ob;
  697.    _loc1_.jumpspeed += _loc1_.gravity;
  698.    if(_loc1_.jumpspeed > game.tileH)
  699.    {
  700.       _loc1_.jumpspeed = game.tileH;
  701.    }
  702.    var _loc2_ = 0;
  703.    if(Key.isDown(39))
  704.    {
  705.       _loc2_ = 1;
  706.    }
  707.    if(Key.isDown(37))
  708.    {
  709.       _loc2_ = -1;
  710.    }
  711.    if(_loc1_.jumpspeed < 0)
  712.    {
  713.       moveChar2(_loc1_,_loc2_,-1,-1);
  714.    }
  715.    else if(_loc1_.jumpspeed > 0)
  716.    {
  717.       moveChar2(_loc1_,_loc2_,1,1);
  718.    }
  719. }
  720. function fly(ob)
  721. {
  722.    var _loc1_ = ob;
  723.    _loc1_.flyspeed += _loc1_.gravity;
  724.    if(_loc1_.flyspeed > game.tileH)
  725.    {
  726.       _loc1_.flyspeed = game.tileH;
  727.    }
  728.    if(_loc1_.flyspeed < 0)
  729.    {
  730.       moveChar(_loc1_,0,-1,-1);
  731.    }
  732.    else if(_loc1_.flyspeed > 0)
  733.    {
  734.       moveChar(_loc1_,0,1,1);
  735.    }
  736. }
  737. function fall(ob)
  738. {
  739.    var _loc1_ = ob;
  740.    if(!_loc1_.fly)
  741.    {
  742.       getMyCorners(_loc1_.x,_loc1_.y + 1,_loc1_);
  743.       if(_loc1_.downleft && _loc1_.downright && !checkMovingTiles(1))
  744.       {
  745.          _loc1_.flyspeed = 0;
  746.          _loc1_.fly = true;
  747.          _loc1_.onMovingTile = false;
  748.          _loc1_.climb = false;
  749.       }
  750.    }
  751. }
  752. function fall2(ob)
  753. {
  754.    var _loc1_ = ob;
  755.    if(!_loc1_.jump)
  756.    {
  757.       getMyCorners(_loc1_.x,_loc1_.y + 1,_loc1_);
  758.       if(_loc1_.downleft && _loc1_.downright && !checkMovingTiles(1))
  759.       {
  760.          _loc1_.jumpspeed = 0;
  761.          _loc1_.onMovingTile = false;
  762.          _loc1_.climb = false;
  763.       }
  764.    }
  765. }
  766. function checkUpLadder(ob)
  767. {
  768.    var _loc1_ = ob;
  769.    var _loc2_ = Math.floor((_loc1_.y + _loc1_.height - 1) / game.tileH);
  770.    var _loc2 = Math.floor((_loc1_.y - _loc1_.height) / game.tileH);
  771.    var upLadder = game["t_" + _loc2 + "_" + _loc1_.xtile].ladder;
  772.    var _loc3_ = game["t_" + _loc2_ + "_" + _loc1_.xtile].ladder;
  773.    if(upLadder || _loc3_)
  774.    {
  775.       return true;
  776.    }
  777.    _loc1_.climb = false;
  778.    fall2(_loc1_);
  779. }
  780. function checkDownLadder(ob)
  781. {
  782.    var _loc1_ = ob;
  783.    var _loc3_ = Math.floor((_loc1_.speed + _loc1_.y + _loc1_.height) / game.tileH);
  784.    var _loc2_ = game["t_" + _loc3_ + "_" + _loc1_.xtile].ladder;
  785.    if(_loc2_)
  786.    {
  787.       return true;
  788.    }
  789. }
  790. function climb(ob, diry)
  791. {
  792.    var _loc1_ = ob;
  793.    _loc1_.climb = true;
  794.    _loc1_.fly = false;
  795.    _loc1_.jump = false;
  796.    _loc1_.y += _loc1_.speed * diry + 1;
  797.    _loc1_.x = _loc1_.xtile * game.tileW + game.tileW / 2;
  798.    updateChar(_loc1_,0,diry);
  799.    return true;
  800. }
  801. function enemyBrain()
  802. {
  803.    var _loc2_ = 0;
  804.    while(_loc2_ < game.currentEnemies.length)
  805.    {
  806.       if(game.currentEnemies[_loc2_].type >= 1 && game.currentEnemies[_loc2_].type <= 5)
  807.       {
  808.          var name = "enemy" + _loc2_;
  809.          var _loc1_ = game[name];
  810.          getMyCorners(_loc1_.x + _loc1_.speed * _loc1_.xMove,_loc1_.y + _loc1_.speed * _loc1_.yMove + 1,_loc1_);
  811.          if(!_loc1_.downleft && !_loc1_.downright)
  812.          {
  813.             moveChar3(_loc1_,_loc1_.xMove,_loc1_.yMove);
  814.          }
  815.          else
  816.          {
  817.             _loc1_.clip._xscale = - _loc1_.clip._xscale;
  818.             _loc1_.xMove = - _loc1_.xMove;
  819.             _loc1_.yMove = - _loc1_.yMove;
  820.          }
  821.       }
  822.       if(game.currentEnemies[_loc2_].type == 6 || game.currentEnemies[_loc2_].type == 7)
  823.       {
  824.          var name = "enemy" + _loc2_;
  825.          _loc1_ = game[name];
  826.          moveChar4(_loc1_,_loc1_.xMove,_loc1_.yMove);
  827.       }
  828.       var xdist = _loc1_.x - char.x;
  829.       var _loc3_ = _loc1_.y - char.y;
  830.       if(char.unDead == false && Math.sqrt(xdist * xdist + _loc3_ * _loc3_) < _loc1_.width + char.width)
  831.       {
  832.          game.totalLives--;
  833.          _root.heroLife--;
  834.          below_mask.lifeShow = game.totalLives;
  835.          if(game.totalLives <= 0)
  836.          {
  837.             _root.gameOver();
  838.          }
  839.          else
  840.          {
  841.             _root.addChar();
  842.          }
  843.       }
  844.       _loc2_ = _loc2_ + 1;
  845.    }
  846. }
  847. function shoot(ob)
  848. {
  849.    var _loc2_ = ob;
  850.    _loc2_.lastshot = getTimer();
  851.    game.bulletcounter = game.bulletcounter + 1;
  852.    if(game.bulletcounter == 5)
  853.    {
  854.       game.bulletcounter = 0;
  855.       _root.char.havinggun = false;
  856.    }
  857.    var _loc1_ = "bullet" + game.bulletcounter;
  858.    game[_loc1_] = new game.Bullet();
  859.    game[_loc1_].id = game.bulletcounter;
  860.    game.bullets.push(game[_loc1_]);
  861.    if(_loc2_.dirx || _loc2_.diry)
  862.    {
  863.       game[_loc1_].dirx = _loc2_.dirx;
  864.       game[_loc1_].diry = _loc2_.diry;
  865.    }
  866.    game[_loc1_].xtile = _loc2_.xtile;
  867.    game[_loc1_].ytile = _loc2_.ytile;
  868.    game.clip.attachMovie("bullet",_loc1_,12000 + game.bulletcounter);
  869.    game[_loc1_].clip = game.clip[_loc1_];
  870.    game[_loc1_].x = _loc2_.x + game[_loc1_].dirx * _loc2_.width;
  871.    game[_loc1_].y = _loc2_.y + game[_loc1_].diry * _loc2_.height;
  872.    game.clip[_loc1_]._x = game[_loc1_].x;
  873.    game.clip[_loc1_]._y = game[_loc1_].y;
  874. }
  875. function moveBullets()
  876. {
  877.    var i = 0;
  878.    while(i < game.bullets.length)
  879.    {
  880.       var _loc1_ = game.bullets[i];
  881.       getMyCorners(_loc1_.x + _loc1_.speed * _loc1_.dirx,_loc1_.y + _loc1_.speed * _loc1_.diry,_loc1_);
  882.       if(_loc1_.downleft && _loc1_.upleft && _loc1_.downright && _loc1_.upright)
  883.       {
  884.          moveChar(_loc1_,_loc1_.dirx,_loc1_.diry);
  885.       }
  886.       else
  887.       {
  888.          _loc1_.clip.removeMovieClip();
  889.          delete game["bullet" + game.bullets[i].id];
  890.          game.bullets.splice(i,1);
  891.       }
  892.       var _loc3_ = 0;
  893.       while(_loc3_ < game.currentEnemies.length)
  894.       {
  895.          var name = "enemy" + game.currentEnemies[_loc3_].id;
  896.          var _loc2_ = game[name];
  897.          var xdist = _loc1_.x - _loc2_.x;
  898.          var ydist = _loc1_.y - _loc2_.y;
  899.          if(Math.sqrt(xdist * xdist + ydist * ydist) < _loc1_.width + _loc2_.width)
  900.          {
  901.             _loc2_.clip.removeMovieClip();
  902.             delete game["enemy" + game.currentEnemies[_loc3_].id];
  903.             _loc1_.clip.removeMovieClip();
  904.             delete game["bullet" + game.bullets[i].id];
  905.             game.bullets.splice(i,1);
  906.             myEnemies[game.currentMap][_loc2_.id] = 0;
  907.             game.totalScores += 100;
  908.             _root.below_mask.scoreShow = game.totalScores;
  909.          }
  910.          _loc3_ = _loc3_ + 1;
  911.       }
  912.       i++;
  913.    }
  914. }
  915. function detectKeys()
  916. {
  917.    var _loc2_ = _root;
  918.    below_mask.climbShow = char.climb;
  919.    below_mask.flyShow = char.fly;
  920.    below_mask.jumpShow = char.jump;
  921.    moveTiles();
  922.    var _loc1_ = _loc2_.char;
  923.    var _loc3_ = false;
  924.    if(Key.isDown(38))
  925.    {
  926.       if(checkUpLadder(_loc2_.char))
  927.       {
  928.          _loc3_ = _loc2_.climb(_loc1_,-1);
  929.       }
  930.       else if(!_loc1_.jump)
  931.       {
  932.          _loc1_.onMovingTile = false;
  933.          _loc1_.jump = true;
  934.          _loc1_.jumpspeed = _loc1_.jumpstart;
  935.       }
  936.    }
  937.    if(Key.isDown(32) && char.climb == false)
  938.    {
  939.       _loc1_.onMovingTile = false;
  940.       _loc1_.fly = true;
  941.       _loc1_.jump = false;
  942.       _loc1_.flyspeed = _loc1_.flystart;
  943.    }
  944.    if(Key.isDown(39) && _loc1_.jump == false)
  945.    {
  946.       getMyCorners(_loc1_.x + _loc1_.speed,_loc1_.y,_loc1_);
  947.       if(_loc1_.upright && _loc1_.downright)
  948.       {
  949.          _loc3_ = _loc2_.moveChar(_loc1_,1,0);
  950.       }
  951.    }
  952.    if(Key.isDown(37) && _loc1_.jump == false)
  953.    {
  954.       getMyCorners(_loc1_.x - _loc1_.speed,_loc1_.y,_loc1_);
  955.       if(_loc1_.downleft && _loc1_.upleft)
  956.       {
  957.          _loc3_ = _loc2_.moveChar(_loc1_,-1,0);
  958.       }
  959.    }
  960.    else if(Key.isDown(40))
  961.    {
  962.       if(!char.fly && !char.jump)
  963.       {
  964.          if(checkDownLadder(_loc2_.char))
  965.          {
  966.             _loc3_ = _loc2_.climb(_loc1_,1);
  967.          }
  968.       }
  969.    }
  970.    if(char.havinggun && Key.isDown(16) && getTimer() > _loc1_.lastshot + _loc1_.shootspeed)
  971.    {
  972.       _loc2_.shoot(_loc1_);
  973.    }
  974.    if(_loc1_.fly)
  975.    {
  976.       _loc3_ = _loc2_.fly(_loc1_);
  977.    }
  978.    if(_loc1_.jump && !_loc1_.fly)
  979.    {
  980.       _loc3_ = _loc2_.jump(_loc1_);
  981.    }
  982.    if(!_loc3_)
  983.    {
  984.       _loc1_.clip.char.gotoAndStop(1);
  985.    }
  986.    else
  987.    {
  988.       _loc1_.clip.char.play();
  989.    }
  990.    if(enemyStop == false)
  991.    {
  992.       _loc2_.enemyBrain();
  993.    }
  994.    _loc2_.moveBullets();
  995.    charChangeDir();
  996. }
  997. function gameOver()
  998. {
  999.    var _loc1_ = _root;
  1000.    clearInterval(_loc1_.f_timeCounter);
  1001.    removeMovieClip(_loc1_.tiles);
  1002.    if(game.doorclose == true)
  1003.    {
  1004.       _loc1_.gotoAndStop("gameover");
  1005.    }
  1006. }
  1007. function init()
  1008. {
  1009.    below_mask.timeShow = game.totalTimes;
  1010.    below_mask.lifeShow = game.totalLives;
  1011.    below_mask.scoreShow = game.totalScores;
  1012.    below_mask.bottleShow = game.totalBottles;
  1013.    f_timeCounter = setInterval(timeCounter,1000);
  1014. }
  1015. function timeCounter()
  1016. {
  1017.    if(game.totalTimes > 0)
  1018.    {
  1019.       game.totalTimes--;
  1020.       if(game.totalTimes == 5)
  1021.       {
  1022.          trace(game.totalTimes);
  1023.          var _loc1_ = new Sound();
  1024.          _loc1_.attachSound("alert");
  1025.          _loc1_.start(0,3);
  1026.       }
  1027.    }
  1028.    else
  1029.    {
  1030.       _root.gameOver();
  1031.    }
  1032.    below_mask.timeShow = game.totalTimes;
  1033. }
  1034. function clearScreen()
  1035. {
  1036.    _root.score = below_mask.scoreShow;
  1037.    gameOver();
  1038. }
  1039. function charChangeDir()
  1040. {
  1041.    if(Key.isDown(38) && Key.isDown(37))
  1042.    {
  1043.       char.clip.gotoAndStop("leftJump");
  1044.       f_bottleTimeMc = false;
  1045.       bottleTimeMc.stop();
  1046.    }
  1047.    else if(Key.isDown(38) && Key.isDown(39))
  1048.    {
  1049.       char.clip.gotoAndStop("rightJump");
  1050.       f_bottleTimeMc = false;
  1051.       bottleTimeMc.stop();
  1052.    }
  1053.    else if(Key.isDown(38))
  1054.    {
  1055.       char.clip.gotoAndStop("jump");
  1056.       f_bottleTimeMc = false;
  1057.       bottleTimeMc.stop();
  1058.    }
  1059.    if(Key.isDown(32) && Key.isDown(37))
  1060.    {
  1061.       f_bottleTimeMc = true;
  1062.       bottleTimeMc.play();
  1063.       char.clip.gotoAndStop("leftFly");
  1064.    }
  1065.    else if(Key.isDown(32) && Key.isDown(39))
  1066.    {
  1067.       f_bottleTimeMc = false;
  1068.       bottleTimeMc.play();
  1069.       char.clip.gotoAndStop("rightFly");
  1070.    }
  1071.    else if(Key.isDown(32) && char.climb == false)
  1072.    {
  1073.       bottleTimeMc.play();
  1074.       f_bottleTimeMc = true;
  1075.       char.clip.gotoAndStop("fly");
  1076.    }
  1077.    else if(Key.isDown(37))
  1078.    {
  1079.       if(char.fly)
  1080.       {
  1081.          char.clip.gotoAndStop("leftFly");
  1082.       }
  1083.       else
  1084.       {
  1085.          f_bottleTimeMc = false;
  1086.          bottleTimeMc.stop();
  1087.          char.clip.gotoAndStop("leftRun");
  1088.       }
  1089.    }
  1090.    else if(Key.isDown(39))
  1091.    {
  1092.       if(char.fly)
  1093.       {
  1094.          char.clip.gotoAndStop("rightFly");
  1095.       }
  1096.       else
  1097.       {
  1098.          f_bottleTimeMc = false;
  1099.          bottleTimeMc.stop();
  1100.          char.clip.gotoAndStop("rightRun");
  1101.       }
  1102.    }
  1103.    else if(Key.isDown(40))
  1104.    {
  1105.       bottleTimeMc.stop();
  1106.       f_bottleTimeMc = false;
  1107.       if(checkDownLadder(_root.char))
  1108.       {
  1109.          char.clip.gotoAndStop("climb");
  1110.       }
  1111.       else
  1112.       {
  1113.          char.clip.gotoAndStop("kneel");
  1114.       }
  1115.    }
  1116.    else if(checkDownLadder(_root.char) && char.climb == true)
  1117.    {
  1118.       char.clip.gotoAndStop("climb");
  1119.    }
  1120.    else
  1121.    {
  1122.       char.clip.gotoAndStop("stand");
  1123.    }
  1124. }
  1125. function controlFunc()
  1126. {
  1127.    var _loc1_ = _root;
  1128.    if(_loc1_.magicWaterUsed == false)
  1129.    {
  1130.       if(_loc1_.char.clip._alpha < 100)
  1131.       {
  1132.          _loc1_.char.clip._alpha += 2;
  1133.       }
  1134.       else
  1135.       {
  1136.          _loc1_.char.undead = false;
  1137.       }
  1138.    }
  1139.    _loc1_.detectKeys();
  1140. }
  1141. function removeFinal_mc()
  1142. {
  1143.    _root.final_mc.removeMovieClip(this);
  1144. }
  1145. _root.attachMovie("below_mask","below_mask",20000);
  1146. below_mask._y = 320;
  1147. var i = 1;
  1148. while(i <= 4)
  1149. {
  1150.    eval("below_mask.btn" add i)._visible = false;
  1151.    i++;
  1152. }
  1153. _root.attachMovie("bg_mask","bg_mask",20001);
  1154. bgSoundFunc("bgSound1");
  1155. var lifeUpNum = 10000;
  1156. var heroLife = 5;
  1157. var everyGateBottle = 10;
  1158. var addLife = 0;
  1159. getURL("FSCommand:allowscale",false);
  1160. f_bottleTimeMc = false;
  1161. f_unDeadMc = false;
  1162. f_enemyStopMc = false;
  1163. magicWaterUsed = false;
  1164. enemyStop = false;
  1165. _root.score = 0;
  1166. myMap2 = [[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1],[1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1],[1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1]];
  1167. myMap1 = [[1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1],[1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1],[1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]];
  1168. game = {tileW:40,tileH:40,doorclose:true,havingBottle:0,currentGate:1,currentMap:1,totalMap:2,itemBottle:4,totalTimes:120,totalLives:_root.heroLife,totalScores:_root.score,totalBottles:_root.everyGateBottle,bulletcounter:0,gateDoorX:8,gateDoorY:2};
  1169. game.bullets = new Array();
  1170. game.Tile0 = function()
  1171. {
  1172. };
  1173. game.Tile0.prototype.walkable = true;
  1174. game.Tile0.prototype.frame = 1;
  1175. game.Tile1 = function()
  1176. {
  1177. };
  1178. game.Tile1.prototype.walkable = false;
  1179. game.Tile1.prototype.frame = 2;
  1180. game.Doors = function(newmap, oldmap)
  1181. {
  1182.    this.newmap = newmap;
  1183.    this.oldmap = oldmap;
  1184. };
  1185. game.Doors.prototype.walkable = true;
  1186. game.Doors.prototype.frame = 3;
  1187. game.Doors.prototype.door = true;
  1188. game.Tile2 = function()
  1189. {
  1190. };
  1191. game.Tile2.prototype = new game.Doors(2,1);
  1192. game.Tile3 = function()
  1193. {
  1194. };
  1195. game.Tile3.prototype = new game.Doors(1,2);
  1196. game.Tile4 = function()
  1197. {
  1198. };
  1199. game.Tile4.prototype = new game.Doors(3,2);
  1200. game.Tile5 = function()
  1201. {
  1202. };
  1203. game.Tile5.prototype = new game.Doors(2,3);
  1204. game.Tile6 = function()
  1205. {
  1206. };
  1207. game.Tile6.prototype = new game.Doors(4,3);
  1208. game.Tile7 = function()
  1209. {
  1210. };
  1211. game.Tile7.prototype = new game.Doors(3,4);
  1212. game.Tile8 = function()
  1213. {
  1214. };
  1215. game.Tile8.prototype = new game.Doors(5,4);
  1216. game.Tile9 = function()
  1217. {
  1218. };
  1219. game.Tile9.prototype = new game.Doors(4,5);
  1220. game.Tile10 = function()
  1221. {
  1222. };
  1223. game.Tile10.prototype.walkable = false;
  1224. game.Tile10.prototype.frame = 2;
  1225. game.Tile10.prototype.ladder = true;
  1226. game.Tile10.prototype.item = "ladder";
  1227. game.Tile11 = function()
  1228. {
  1229. };
  1230. game.Tile11.prototype.walkable = true;
  1231. game.Tile11.prototype.frame = 1;
  1232. game.Tile11.prototype.ladder = true;
  1233. game.Tile11.prototype.item = "ladder";
  1234. myItems = [[0],[[1,3,3],[1,12,2],[2,12,5],[2,1,2],[3,8,3],[3,9,3],[3,1,5],[3,2,5]],[[1,2,2],[1,11,1],[2,14,2],[2,2,4],[3,3,4],[3,4,4],[3,14,3],[3,14,4]]];
  1235. game.Item1 = function()
  1236. {
  1237. };
  1238. game.Item1.prototype.typeNum = 1;
  1239. game.Item2 = function()
  1240. {
  1241. };
  1242. game.Item2.prototype.typeNum = 2;
  1243. game.Item3 = function()
  1244. {
  1245. };
  1246. game.Item3.prototype.typeNum = 3;
  1247. game.Item4 = function()
  1248. {
  1249. };
  1250. game.Item4.prototype.typeNum = 4;
  1251. game.Item5 = function()
  1252. {
  1253. };
  1254. game.Item5.prototype.typeNum = 5;
  1255. game.Item6 = function()
  1256. {
  1257. };
  1258. game.Item6.prototype.typeNum = 6;
  1259. game.Item7 = function()
  1260. {
  1261. };
  1262. game.Item7.prototype.typeNum = 7;
  1263. game.Item8 = function()
  1264. {
  1265. };
  1266. game.Item8.prototype.typeNum = 8;
  1267. game.Item9 = function()
  1268. {
  1269. };
  1270. game.Item9.prototype.typeNum = 9;
  1271. game.Item10 = function()
  1272. {
  1273. };
  1274. game.Item10.prototype.typeNum = 10;
  1275. game.Item11 = function()
  1276. {
  1277. };
  1278. game.Item11.prototype.typeNum = 11;
  1279. myEnemies = [[0],[[1,2,3],[2,12,3]],[[1,3,2],[2,8,8]]];
  1280. game.Enemyp1 = function()
  1281. {
  1282. };
  1283. game.Enemyp1.prototype.xMove = 1;
  1284. game.Enemyp1.prototype.yMove = 0;
  1285. game.Enemyp1.prototype.speed = -2;
  1286. game.Enemyp2 = function()
  1287. {
  1288. };
  1289. game.Enemyp2.prototype.xMove = 1;
  1290. game.Enemyp2.prototype.yMove = 0;
  1291. game.Enemyp2.prototype.speed = 2;
  1292. game.Enemyp3 = function()
  1293. {
  1294. };
  1295. game.Enemyp3.prototype.xMove = 1;
  1296. game.Enemyp3.prototype.yMove = 0;
  1297. game.Enemyp3.prototype.speed = 2;
  1298. game.Enemyp4 = function()
  1299. {
  1300. };
  1301. game.Enemyp4.prototype.xMove = 1;
  1302. game.Enemyp4.prototype.yMove = 0;
  1303. game.Enemyp4.prototype.speed = 2;
  1304. game.Enemyp5 = function()
  1305. {
  1306. };
  1307. game.Enemyp5.prototype.xMove = 1;
  1308. game.Enemyp5.prototype.yMove = 0;
  1309. game.Enemyp5.prototype.speed = -1;
  1310. game.Enemyp6 = function()
  1311. {
  1312. };
  1313. game.Enemyp6.prototype.xMove = 1;
  1314. game.Enemyp6.prototype.yMove = 0;
  1315. game.Enemyp6.prototype.speed = -3;
  1316. game.Enemyp7 = function()
  1317. {
  1318. };
  1319. game.Enemyp7.prototype.xMove = 1;
  1320. game.Enemyp7.prototype.yMove = 0;
  1321. game.Enemyp7.prototype.speed = 3;
  1322. char = {xtile:7,ytile:5,speed:4,unDead:true,flystart:-14,jumpstart:-10,gravity:1.2,fly:false,jump:false,havinggun:false,shootspeed:1000,climb:false,onMovingTile:false};
  1323. buildMap(_root["myMap" + game.currentMap]);
  1324. fall(_root.char);
  1325. init();
  1326. stop();
  1327. _root.createEmptyMovieClip("controller",20002);
  1328. controller.onEnterFrame = function()
  1329. {
  1330.    controlFunc();
  1331. };
  1332. _root.onEnterFrame = function()
  1333. {
  1334.    if(Key.isDown(17))
  1335.    {
  1336.       pauseMc.play();
  1337.    }
  1338. };
  1339.